var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("BaseModuleUI"),
    a = e("NotifyEventType"),
    i = e("GlobalParams"),
    r = e("AssetsManager"),
    s = e("AudioManager"),
    l = e("Game"),
    c = cc._decorator,
    d = c.ccclass,
    h = c.property,
    _ = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.role_soldier_view = null),
                (t.monster_pos = [
                    new cc.Vec2(-1700, 800),
                    new cc.Vec2(1700, 800),
                    new cc.Vec2(0, -1e3),
                    new cc.Vec2(0, 800),
                    new cc.Vec2(0, -1200)
                ]),
                t
            );
        }
        return (
            __extends(t, e),
            (t.prototype.addEvent = function () {
                this.attachEvent(a.default.SEND_CREATE_MONSTER_INDEX, this.createMonster, this);
            }),
            (t.prototype.createMonster = function (e, t) {
                this.createOneMonster(t);
            }),
            (t.prototype.createOneMonster = function (e) {
                var t = null;
                e == l.MonsterType.red
                    ? (t = cc.instantiate(r.default.getInstance().getFightPrefab("monster_red")))
                    : e == l.MonsterType.bule
                    ? (t = cc.instantiate(r.default.getInstance().getFightPrefab("monster_bule")))
                    : e == l.MonsterType.spider
                    ? (t = cc.instantiate(r.default.getInstance().getFightPrefab("monster_spider")))
                    : e == l.MonsterType.dragon
                    ? (t = cc.instantiate(r.default.getInstance().getFightPrefab("monster_dragon")))
                    : e == l.MonsterType.big_dragon &&
                      (this.role_soldier_view.getChildByName("monster_spider") &&
                          (this.role_soldier_view.getChildByName("monster_spider").destroy(),
                          (i.GlobalParams.MonsterDisNum[2].time = -1)),
                      (t = cc.instantiate(r.default.getInstance().getFightPrefab("monster_big_dragon"))),
                      s.default.getInstance().playFx("dragon_idle")),
                    t.setPosition(this.monster_pos[e - 1]),
                    t.setParent(this.role_soldier_view);
            }),
            __decorate([h(cc.Node)], t.prototype, "role_soldier_view", void 0),
            __decorate([d], t)
        );
    })(n.default);
o.default = _;
